<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/views/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/views/include/nocachehead.jsp"%>
<title>上传照片 - ${requestScope.album.albumName }</title>
</head>
<body>
	<div>
		<!-- main content start -->
		<div>
			<c:if test="${requestScope.message ne ''}">
				<c:out value="${requestScope.message}" />
			</c:if>
			<c:if test="${requestScope.album.activity eq 'UNDELETABLE'}">
				不能上传照片到头像相册
			</c:if>
		</div>
		返回<a href="${pageContext.request.contextPath}/album/list/${requestScope.album.ownerId }.html">我的相册</a>
		<c:if test="${requestScope.album.activity ne 'UNDELETABLE'}">
		<div>
			<form method="POST" action="${pageContext.request.contextPath}/album/upload/${requestScope.album.id }.html" enctype="multipart/form-data">
				<input name="file" style="width:220px" id="img0" type="file"><br/>
				<input name="file" style="width:220px" id="img1" type="file"><br/>
				<input name="file" style="width:220px" id="img2" type="file"><br/>
				<input name="file" style="width:220px" id="img3" type="file"><br/>
				<input name="file" style="width:220px" id="img4" type="file"><br/>
				<input type="hidden" name="submitToken" value="<skyline:sessionAttribute key="SESSION_SUBMIT_TOKEN" />">
				<input type="submit" value="上传" class="" />
				<input type="button" value="取消" class="" onclick="window.location='${pageContext.request.contextPath}/album/list/${requestScope.album.ownerId}.html';"/>
			</form>
			<script type="text/javascript">
			(function($){
				$(document).ready(function(){
					$("input[type=file]").each(function(){
						$(this).change(function(){
							if(! /(.)*\.(jpg|jpeg|gif|bmp|png)$/.test(this.value.toLowerCase())){
								alert('图片上传只支持JPG,JPEG,GIF,BMP,PNG格式文件');
								this.value='';
							}
						});
					});
				});
			})(jQuery);
			</script>			
		</div>
		</c:if>
		<!-- main content end -->
	</div>
</body>
</html>